<?php

namespace App\Vilidate\playlet;

/**
 * user控制器下的验证规则类
 */
class PlayletController
{
    public $index = ['rule'=>[], 'msg'=>[]];

    public $episodesIndex = ['rule'=>[], 'msg'=>[]];

    public $clickOnline = ['rule'=>[], 'msg'=>[]];

    public $clickOffline = ['rule'=>[], 'msg'=>[]];

    public $batchUpload = [
        'rule'=>[
            'videos' => 'required|array',
            'videoType' => 'required',
        ],
        'msg'=>[
            'videoType.required' => '视频类型不能为空',
            'videos.required' => '视频不能为空',
            'videos.array' => '视频应为数组',
        ]
    ];

    public $view = ['rule'=>[], 'msg'=>[]];

    public $delete = ['rule'=>[], 'msg'=>[]];
    public $auditDrama = ['rule'=>[], 'msg'=>[]];

    public $episodesList = ['rule'=>[], 'msg'=>[]];
    public $limitNumber = [
        'rule'=>[
            'pay_episodes_number' => 'required|integer'
        ],
        'msg'=>[
            'pay_episodes_number.required' => '最高付费集数不能为空',
            'pay_episodes_number.integer' => '最高付费集数应为整数'
        ]
    ];
    public $registrationTime = [
        'rule'=>[
            'registration_at' => 'required|date'
        ],
        'msg'=>[
            'registration_at.required' => '授权书到期时间不能为空',
            'registration_at.date' => '授权书到期时间应该为日期'
        ]
    ];


    public $weComBind = [
        'rule'=>[
            'we_com_id' => 'required|integer'
        ],
        'msg'=>[
            'we_com_id.required' => '企业微信不能为空',
            'we_com_id.integer' => '企业微信应为整数'
        ]
    ];

    public $create = [
        'rule'=>[
            'name' => 'required|string',
            'introduction' => 'required|string',
            'cover' => 'required|string',
            'status' => 'required',
        ],
        'msg'=>[
            'name.required' => '名称不能为空',
            'introduction.string' => '剧集简介为字符串',
            'introduction.required' => '剧集简介不能为空',
            'cover.required' => '剧集头像不能为空',
            'status.required' => '状态不能为空',
        ]
    ];
    public $mergePlaylet = [
        'rule'=>[
            'merge_playlet_id' => 'required|array',
            'name' => 'required|string',
            'introduction' => 'required|string',
            'cover' => 'required|string',
            'status' => 'required',
        ],
        'msg'=>[
            'merge_playlet_id.required' => '合并短剧ID不能为空',
            'merge_playlet_id.array' => '合并短剧为数组',
            'name.required' => '名称不能为空',
            'introduction.string' => '剧集简介为字符串',
            'introduction.required' => '剧集简介不能为空',
            'cover.required' => '剧集头像不能为空',
            'status.required' => '状态不能为空',
        ]
    ];

    public $update = [
        'rule'=>[
            'name' => 'required|string',
            'introduction' => 'required|string',
            'cover' => 'required|string',
            'status' => 'required',
//            'producer' => 'required|string',
//            'registration_number' => 'required|string',
//            'registration_number_url' => 'required|url',
        ],
        'msg'=>[
            'name.required' => '名称不能为空',
            'introduction.string' => '剧集简介为字符串',
            'introduction.required' => '剧集简介不能为空',
            'cover.required' => '剧集头像不能为空',
            'status.required' => '状态不能为空',
//            'producer.required' => '制作方不能为空',
//            'registration_number.required' => '剧目备案号不能为空',
//            'registration_number_url.required' => '剧目播放授权材料图片不能为空',
        ]
    ];
}